package com.mrogrape.notepad.ui.find;

import java.io.Serializable;
import java.util.LinkedList;
import java.util.List;

public class FindDialogSettings implements Serializable {

	/** serialVersionUID */
	private static final long serialVersionUID = 1L;
	
	private List<String> searchForHistory = new LinkedList<String>();
	private List<String> replaceWithHistory = new LinkedList<String>();
	private Integer searchForHistoryCapacity = 10;
	private Integer replaceWithHistoryCapacity = 10;
	private Boolean searchBackward = true;
	private Boolean selectionOnly = false;
	private Boolean matchCase = false;
	private Boolean wholeWord = false;
	private Boolean regularExpressions = false;
	private Boolean wrapSearch = true;
	
	
	public int getSearchForHistoryCapacity() {
		
		if(this.searchForHistoryCapacity == null || this.searchForHistoryCapacity == 0){
			this.searchForHistoryCapacity = 10;
		}
		
		return this.searchForHistoryCapacity;
	}
	
	public void setSearchForHistoryCapacity(int searchForHistoryCapacity) {
		
		this.searchForHistoryCapacity = searchForHistoryCapacity;
	}
	
	public int getReplaceWithHistoryCapacity() {
		
		if(this.replaceWithHistoryCapacity == null || this.replaceWithHistoryCapacity == 0){
			this.replaceWithHistoryCapacity = 10;
		}
		return this.replaceWithHistoryCapacity;
	}
	
	public void setReplaceWithHistoryCapacity(int replaceWithHistoryCapacity) {
		this.replaceWithHistoryCapacity = replaceWithHistoryCapacity;
	}
	
	public List<String> getSearchForHistory() {
		
		if(this.searchForHistory == null){
			this.searchForHistory = new LinkedList<String>();
		}
		return this.searchForHistory;
	}
	
	public void setSearchForHistory(List<String> searchForHistory) {
		this.searchForHistory = searchForHistory;
	}
	
	public List<String> getReplaceWithHistory() {
		
		if(this.replaceWithHistory == null){
			this.replaceWithHistory = new LinkedList<String>();
		}
		return this.replaceWithHistory;
	}
	
	public void setReplaceWithHistory(List<String> replaceWithHistory) {
		this.replaceWithHistory = replaceWithHistory;
	}
	
	public boolean isSearchBackward() {
		
		if(this.searchBackward == null){
			this.searchBackward = false;
		}
		return this.searchBackward;
	}
	
	public void setSearchBackward(boolean searchBackward) {
		this.searchBackward = searchBackward;
	}
	
	public boolean isSelectionOnly() {
		
		if(this.selectionOnly == null){
			this.selectionOnly = false;
		}
		return this.selectionOnly;
	}
	
	public void setSelectionOnly(boolean selectionOnly) {
		this.selectionOnly = selectionOnly;
	}
	
	public boolean isMatchCase() {
		
		if(this.matchCase == null){
			this.matchCase = false;
		}
		return this.matchCase;
	}
	
	public void setMatchCase(boolean matchCase) {
		this.matchCase = matchCase;
	}
	
	public boolean isWholeWord() {
		
		if(this.wholeWord == null){
			this.wholeWord = false;
		}
		return this.wholeWord;
	}
	
	public void setWholeWord(boolean wholeWord) {
		this.wholeWord = wholeWord;
	}
	
	public boolean isRegularExpressions() {
		
		if(this.regularExpressions == null){
			this.regularExpressions = false;
		}
		return this.regularExpressions;
	}
	
	public void setRegularExpressions(boolean regularExpressions) {
		this.regularExpressions = regularExpressions;
	}
	
	public boolean isWrapSearch() {
		
		if(this.wrapSearch == null){
			this.wrapSearch = true;
		}
		return this.wrapSearch;
	}
	public void setWrapSearch(boolean wrapSearch) {
		this.wrapSearch = wrapSearch;
	}

	
}
